#ifndef __MavenSearch__H__
#define __MavenSearch__H__

#include <QObject>
#include <qlist.h>

QT_BEGIN_NAMESPACE
class NetworkRequest;
class MavenResult;
QT_END_NAMESPACE
class MavenSearch : public QObject
{
    Q_OBJECT
public:
    explicit MavenSearch(QObject *parent=nullptr);

    void search(QString search, int rows, QString wt);
    void searchAllVersion(QString search, int rows, QString wt);
    MavenResult* getResult(QString id);

signals:
    void doc(MavenResult *result);
    void docs(QList<MavenResult*> results);

private:
    NetworkRequest *request;
    QString URL;
    QString keyword;

    QList<MavenResult*> m_results;
    QList<MavenResult*> m_oldresults;
};

#endif  //!__MavenSearch__H__